///////////////////////////////////////////////////////////////////////////
//
//  @ File      :	bn.h
//  @ Author    :	zhoukaifeng<zhoukaifeng@kingsoft.com>
//  @ DateTime  :	2014-10-16 20:40:46 
//  @ Brief     :
//
///////////////////////////////////////////////////////////////////////////

#ifndef __BN__
#define __BN__

#include <string>
#include <vector>

#define T char

#define BN_CHECK_TOP(c)  \
    while (c.size() > 1 && c[c.size() - 1] == 0){ \
        c.pop_back(); \
    }

#define BN_REVERSE(c) \
    int sizeC = c.size(); \
    for (int i = 0; i < sizeC / 2; ++i){ \
        std::swap(c[i], c[sizeC - 1 - i]); \
    }

class BigNumber:public std::vector<T>
{
public:
    BigNumber();
    BigNumber(int size);
    BigNumber(int size, T defVal);
    BigNumber(std::string initVal);
    BigNumber(const BigNumber& t);
    virtual ~BigNumber();

    int         size() const; 
    std::string ToString();

    BigNumber& operator =(const BigNumber& t);
    BigNumber operator +(const BigNumber& t);
    BigNumber operator -(const BigNumber& t);
    BigNumber operator *(const BigNumber& t);
    BigNumber operator /(const BigNumber& t);
    BigNumber operator %(const BigNumber& t);

    operator int();
    operator std::string();

public:
    static BigNumber ValueOf(int n);
    static BigNumber ValueOf(std::string val);
    static BigNumber Add(const BigNumber& a, const BigNumber& b);
    static BigNumber Sub(const BigNumber& a, const BigNumber& b);
    static BigNumber Mul(const BigNumber& a, const BigNumber& b);
    static BigNumber Div(const BigNumber& a, const BigNumber& b, BigNumber& rem);
    static BigNumber Mod(const BigNumber& a, const BigNumber& b);
    static BigNumber Exp(const BigNumber& a, const BigNumber& b);
    static BigNumber ExpMod(const BigNumber& a, const BigNumber& b, const BigNumber& mod);

protected:
    static int       _UnsignedCmp(const BigNumber& a, const BigNumber& b);
    static BigNumber _UnsignedAdd(const BigNumber& a, const BigNumber& b);
    static BigNumber _UnsignedSub(const BigNumber& a, const BigNumber& b);
    static BigNumber _UnsignedMul(const BigNumber& a, const BigNumber& b);
    static BigNumber _UnsignedDiv(const BigNumber& a, const BigNumber& b, BigNumber& rem);

    static BigNumber _UnsignedMulBit(const BigNumber& a, T bit);
    static void      _UnsignedMulBitNoCopy(BigNumber& a, T bit);
    static BigNumber _UnsignedDivBit(const BigNumber& a, T bit);
    static void      _UnsignedDivBitNoCopy(BigNumber& a, T bit);

protected:
    int m_negative;

protected:
    static int s_radix;
};

__declspec(selectany) int BigNumber::s_radix = 10;

#endif

BigNumber::BigNumber()
: m_negative(0){}

BigNumber::BigNumber(int size)
: std::vector<T>(size, 0)
, m_negative(0){}

BigNumber::BigNumber(int size, T defVal)
: std::vector<T>(size, defVal)
, m_negative(0){}

BigNumber::BigNumber(const BigNumber& t):std::vector<T>(t)
{
    s_radix = t.s_radix;
    m_negative = t.m_negative;
}

BigNumber::~BigNumber()
{

}


int BigNumber::size() const
{
    return (int)std::vector<T>::size();
}

std::string BigNumber::ToString()
{
    std::string s;
    if (m_negative){
        s += "-";
    }
    for (int i = int(size() - 1); i >= 0; --i){
        s += operator[](i) + '0';
    }
    return s;
}

BigNumber& BigNumber::operator=(const BigNumber& t)
{
    std::vector<T>::operator =(t);

    s_radix = t.s_radix;
    m_negative = t.m_negative;

    return *this;
}

BigNumber BigNumber::operator +(const BigNumber& t)
{
    return Add(*this, t);
}

BigNumber BigNumber::operator -(const BigNumber& t)
{
    return Sub(*this, t);
}

BigNumber BigNumber::operator *(const BigNumber& t)
{
    return Mul(*this, t);
}

BigNumber BigNumber::operator /(const BigNumber& t)
{
    BigNumber tmp;
    return Div(*this, t, tmp);
}

BigNumber BigNumber::operator %(const BigNumber& t)
{
    return Mod(*this, t);
}

BigNumber::operator int()
{
    int ans = 0;
    for (int i = int(size() - 1); i >= 0; --i){
        ans = ans * 10 + operator[](i);
    }

    if (m_negative){
        ans = -ans;
    }

    return ans;
}

BigNumber::operator std::string()
{
    return ToString();
}


BigNumber BigNumber::ValueOf(int n)
{
    BigNumber c;
    if (n < 0)
    {
        n = -n;
        c.m_negative = 1;
    }
    while(n > 0){
        c.push_back(n % c.s_radix);
        n /= c.s_radix;
    }
    if (c.empty()){
        c.push_back(n);
    }
    return c;
}

BigNumber BigNumber::ValueOf(std::string val)
{
    BigNumber t(int(val.length()), 0);
    for (int i = int(val.length() - 1), j = 0; i >= 0; --i){
        t[j++] = val[i] - '0';
    }
    return t;
}


BigNumber BigNumber::Add(const BigNumber& a, const BigNumber& b)
{
    BigNumber c;
    const BigNumber *ap = &a;
    const BigNumber *bp = &b;
    if (a.m_negative ^ b.m_negative){
        if (a.m_negative){
            ap = &b;
            bp = &a;
        }
        int differ = _UnsignedCmp(*ap, *bp);
        if (differ == 0){
            c = BigNumber::ValueOf(0);
        }
        else if(differ > 0){
            c = _UnsignedSub(*ap, *bp);
            c.m_negative = ap->m_negative;
        }
        else {
            c = _UnsignedSub(*bp, *ap);
            c.m_negative = bp->m_negative;
        }
    }
    else {
        c.m_negative = 0;
        c = _UnsignedAdd(a, b);
    }
    return c;
}

BigNumber BigNumber::Sub(const BigNumber& a, const BigNumber& b)
{
    BigNumber t = b;

    t.m_negative ^= 1;

    return Add(a, t);
}


BigNumber BigNumber::Mul(const BigNumber& a, const BigNumber& b)
{
    BigNumber c = _UnsignedMul(a, b);
    c.m_negative = a.m_negative ^ b.m_negative;
    return c;
}

BigNumber BigNumber::Div(const BigNumber& a, const BigNumber& b, BigNumber& rem)
{
    BigNumber c = _UnsignedDiv(a, b, rem);
    rem.m_negative = a.m_negative;
    c.m_negative = a.m_negative ^ b.m_negative;
    return c;
}

BigNumber BigNumber::Mod(const BigNumber& a, const BigNumber& b)
{
    int differ = _UnsignedCmp(a, b);
    if (differ  == 0){
        return BigNumber::ValueOf(0);
    }
    else if (differ < 0){
        return a;
    }
    else {
        BigNumber c;
        Div(a, b, c);
        return c;
    }
}

BigNumber BigNumber::Exp(const BigNumber& a, const BigNumber& b)
{
    BigNumber x(a);
    BigNumber y(b);
    BigNumber ret(BigNumber::ValueOf(1));
    BigNumber zero(BigNumber::ValueOf(0));
    while (_UnsignedCmp(y, zero) > 0){
        if (y[0] & 1){
            ret = Mul(ret, x);
        }
        x = Mul(x, x);
        _UnsignedDivBitNoCopy(y, 2);
    }
    ret.m_negative = (a.m_negative & b[0] & 1);
    return ret;
}


BigNumber BigNumber::ExpMod(const BigNumber& a, const BigNumber& b, const BigNumber& mod)
{
    BigNumber x(a);
    BigNumber y(b);
    BigNumber ret(BigNumber::ValueOf(1));
    BigNumber zero(BigNumber::ValueOf(0));
    while (_UnsignedCmp(y, zero) > 0){
        if (y[0] & 1){
            ret = Mul(ret, x);
            ret = Mod(ret, mod);
        }
        x = Mul(x, x);
        x = Mod(x, mod);
        _UnsignedDivBitNoCopy(y, 2);
    }
    ret.m_negative = (a.m_negative & b[0] & 1);
    return ret;
}

int BigNumber::_UnsignedCmp(const BigNumber& a, const BigNumber& b)
{
    int differ = int(a.size() - b.size());
    if (differ != 0){
        return differ;
    }
    for (int i = int(a.size() - 1); i >= 0; --i){
        differ = a[i] - b[i];
        if (differ != 0){
            return differ;
        }
    }
    return 0;
}

BigNumber BigNumber::_UnsignedAdd(const BigNumber& a, const BigNumber& b)
{
    const BigNumber *ap = &a;
    const BigNumber *bp = &b;

    if (a.size() < b.size()){
        ap = &b;
        bp = &a;
    }

    int i = 0;
    int carry = 0;
    BigNumber c(int(ap->size()), 0);

    for (; i < int(bp->size()); ++i){
        carry += (*ap)[i] + (*bp)[i];
        c[i] = carry % s_radix;
        carry /= s_radix;
    }

    for (; i < int(ap->size()); ++i){
        carry += (*ap)[i];
        c[i] = carry % s_radix;
        carry /= s_radix;
        if (carry == 0){
            ++i;
            break;
        }
    }

    for (; i < int(ap->size()); ++i){
        c[i] = (*ap)[i];
    }

    if (carry){
        c.push_back(carry);
    }

    return c;
}

BigNumber BigNumber::_UnsignedSub(const BigNumber& a, const BigNumber& b)
{
    int i = 0;
    int carry = 0;
    BigNumber c(int(a.size()), 0);

    for(; i < int(b.size()); ++i){
        carry = a[i] - b[i] - carry;
        if (carry < 0){
            c[i] = s_radix + carry;
            carry = 1;
        }
        else {
            c[i] = carry;
            carry = 0;
        }
    }

    for (; i < int(a.size()); ++i){
        carry = a[i] - carry;
        if (carry < 0){
            c[i] = s_radix + carry;
            carry = 1;
        }
        else {
            c[i] = carry;++i;
            break;
        }
    }

    for (; i < int(a.size()); ++i){
        c[i] = a[i];
    }

    BN_CHECK_TOP(c);

    return c;
}


BigNumber BigNumber::_UnsignedMul(const BigNumber& a, const BigNumber& b)
{
    BigNumber c = BigNumber::ValueOf(0);
    for (int i = int(a.size() - 1); i >= 0; --i){
        c = _UnsignedMulBit(c, s_radix);
        c = _UnsignedAdd(c, _UnsignedMulBit(b, a[i]));
    }
    return c;
}

BigNumber BigNumber::_UnsignedDiv(const BigNumber& a, const BigNumber& b, BigNumber& rem)
{
    int differ = _UnsignedCmp(a, b);
    if (differ < 0){
        rem = a;
        return BigNumber::ValueOf(0);
    }
    else if (differ == 0){
        rem = BigNumber::ValueOf(0);
        return  BigNumber::ValueOf(1);
    }
    else {
        BigNumber c;
        BigNumber tmp_a = BigNumber::ValueOf(0);

        int sizeB = b.size();
        for (int i = a.size() - 1; i >= 0; --i){

            _UnsignedMulBitNoCopy(tmp_a, s_radix);
            tmp_a = Add(tmp_a, BigNumber::ValueOf(a[i]));
            if (_UnsignedCmp(tmp_a, b) < 0){
                c.push_back(0);
                continue;
            }

            int maxBit = 0;
            for (int j = tmp_a.size() - 1;  j >= sizeB - 1; --j){
                maxBit = maxBit * 10 + tmp_a[j];
            }

            maxBit = std::min(maxBit / b[sizeB - 1], s_radix - 1);

            BigNumber tmp_b = _UnsignedMulBit(b, maxBit);
            for (int j = maxBit; j >= 0; --j){
                if (_UnsignedCmp(tmp_a, tmp_b) >= 0){
                    tmp_a = _UnsignedSub(tmp_a, tmp_b);
                    c.push_back(j);
                    break;
                }
                tmp_b = _UnsignedSub(tmp_b, b);
            }
        }
        rem = tmp_a;
        BN_REVERSE(c);
        BN_CHECK_TOP(c);
        return c;
    }
}

BigNumber BigNumber::_UnsignedMulBit(const BigNumber& a, T bit)
{
    BigNumber c(a);
    _UnsignedMulBitNoCopy(c, bit);
    return c;
}

void BigNumber::_UnsignedMulBitNoCopy(BigNumber& a, T bit)
{
    int carry = 0;
    for (int i = 0; i < a.size(); ++i){
        carry += (int)a[i] * (int)bit;
        a[i] = T(carry % s_radix);
        carry /= s_radix;
    }
    if (carry){
        a.push_back(carry);
    }
    BN_CHECK_TOP(a);
}


BigNumber BigNumber::_UnsignedDivBit(const BigNumber& a, T bit)
{
    BigNumber c(a);
    _UnsignedDivBit(c, bit);
    return c;
}


void BigNumber::_UnsignedDivBitNoCopy(BigNumber& a, T bit)
{
    int carry = 0;
    for (int i = a.size() - 1; i >= 0; --i){
        carry = carry * s_radix + a[i];
        a[i] = carry / bit;
        carry %= bit;
    }
    BN_CHECK_TOP(a);
}


char buf[2][1100];

int main()
{
    int cas, cass;
    scanf("%d", &cass);
    for (cas = 1; cas <= cass; ++cas){
        scanf("%s%s", buf[0], buf[1]);
        BigNumber a(BigNumber::ValueOf(buf[0]));
        BigNumber b(BigNumber::ValueOf(buf[1]));
        if (cas > 1){
            puts("");
        }
        printf("Case %d:\n", cas);
        printf("%s + %s = %s\n", buf[0], buf[1], std::string(a + b).c_str());
    }
    return 0;
}